home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / util / cli / UnixUtils.lha / UnixUtils / README < prev    next >
Encoding:
Text File  |  1992-04-14  |  9.8 KB  |  195 lines

  1.      This  is  a  set of Unix utilities; I mean a set of programs with
  2. the  same  name  and purpose of various common Unix programs, and that
  3. accept  the same switches as their Unix counterparts.  All of them are
  4. callable  from  CLI only, and all print a short help text if scheduled
  5. with  invalid  arguments  (try the program name followed by a question
  6. mark,  e.g.  "head ?"); the only exception is the Unix command "find",
  7. that  is  implemented  with  a  different name and behaviour, and with
  8. different switches, as the Amiga program "tree".
  9.  
  10.      The  Unix  programs  are:   "head",  "tail",  "sort",  "strings",
  11. "diff";  and, as already said, "find". A "grep" was also foreseen, but
  12. the   "grep"  program  (from  Angela  Schmidt)  distributed  with  the
  13. pattern.library  on  Fish  disk  625 was better than mine :-( ...  Get
  14. that one!
  15.  
  16. -----
  17.  
  18. SORT:  AmigaDOS has already (in C:) a "sort" program; why, then, write
  19. another  one?   A  reason  could  have  been  the wish to use the same
  20. switches  I  am  used  to  on my Unix machine; or, perhaps, simply the
  21. amusement  I  have  writing  programs; (any way, my version of SORT is
  22. quicker  than  C:SORT  ;-) ...  SORT comes in three flavors, i.e.  you
  23. will  find  three  executables:   "sort",  "s_sort"  and "b_sort"; all
  24. related  to the same source files, but with different compile options.
  25. "sort"  is  the  normal  version,  that  reads  the  input file(s) and
  26. organises  their  content  in a binary tree in memory before the final
  27. output;  "s_sort"  is a "simplified" sort that accepts only the switch
  28. "-r"  (sort  in  reverse  order), and that performs the "alphabetical"
  29. ordering of the file lines starting from column 1:  being that one the
  30. most  common option, I have written a specialised and quicker version.
  31. As an example, a file containing 1202 lines of ASCII text (47100 bytes
  32. total)  can  be  sorted  (by  s_sort) on a vanilla A500 in less than 4
  33. seconds,  against  the  _24_ seconds needed from c:sort (AmigaDOS 1.3:
  34. Kickstart  34.5, Workbench 34.28).  "b_sort" is the same as "sort" but
  35. uses  for storage a "balanced" binary tree, according to the algorithm
  36. of  Adel'son-Vel'skij  and  Landis  as described from D.  E.  Knuth in
  37. "The  art  of  computer programming" (Addison-Wesley) - Vol.  3, pagg.
  38. 451  -  471.   This leads to a more efficient searching along the tree
  39. for "unbalanced" input (i.e.  for almost sorted files), but is only an
  40. exercise in computer science without pratical effect normally; so that
  41. you don't really need to use b_sort.
  42.  
  43. -----
  44.  
  45. DIFF:   this  is a port, to the Amiga (for the SAS C compiler), of the
  46. GNU  "diff"  program.   It  has  been derived, with some changes, from
  47. another  port  due  to  Martin Hohl; refer to the file DIFF_README for
  48. more  information  about the port and about this "diff"'s options.  In
  49. the  subdirectory  named  "Source/Diff" I have placed the original GNU
  50. sources  and the modifications for the Amiga, with the GNU disclaimer.
  51. This  "diff"  is  more complete than the one that SAS distributes with
  52. his C compiler, but quite huge; you could be forced to raise the stack
  53. when using Unix regular expressions (a requester "STACK OVERFLOW" will
  54. appear).
  55.  
  56. -----
  57.  
  58. FIND:   "find"  is  one  of  the  most useful commands under Unix; but
  59. instead  of  reinventing  the  wheel  writing a "find" from scratch, I
  60. liked  better to modify an existing program:  it is "tree", from Tomas
  61. Rokicki,  released to the public domain and published in the Fred Fish
  62. collection  on  disk  306.  "tree", like "find", walks through all the
  63. directories  below some starting location, and performs some action on
  64. their   content  (but,  for  AmigaDOS,  only  on  the  "normal"  files
  65. encountered,  and  not  on  subdirectories); only, instead of directly
  66. performing  the required action, "tree" can build a command file that,
  67. after having been later examined, you can execute.  You see, I hate to
  68. perform mechanically actions that could be destructive without a check
  69. for  unexpected  behaviours...   I  have  placed in this directory the
  70. original README file for "tree"; what I have done is the following:
  71.  
  72.      The  program  has  been  extensively  cleaned  and rewritten.  An
  73. option  has  been  added  to specify the starting directory, -r:  e.g.
  74. the command "tree -r work:  ..." will list the tree directory starting
  75. from  work: .  The  directories to be excluded can be specified giving
  76. their full path with the option -D (e.g.:  "tree -D work:tex/pk ..."),
  77. or  their  name only with the option -d:  "tree -d temp ..." will skip
  78. EVERY directory in the scanned tree having name "temp".
  79.  
  80.      If  you have pattern.library (from Angela Schmidt, Fish disk 625)
  81. installed,  you  can  specify a set of patterns separated from blanks,
  82. after  one  of  the four options -n, +n, -N or +N; the capital N means
  83. that  in  the  pattern  the case is significant, where the lowercase n
  84. means  that it is NOT significant.  If the first character is a minus,
  85. all files matching the given patterns will NOT be listed; with a plus,
  86. ONLY  the files with names matching the given patterns will be listed.
  87. Of  these  four options, only one can be specified.  You can still use
  88. the  program if you do not have the pattern.library installed; but you
  89. CANNOT use one of these four options.
  90.  
  91.      You  can specify a set of file extensions after the options -x or
  92. +x,  with blanks between them (the case is not significant):  with -x,
  93. all  files having the quoted extensions are EXCLUDED from the list; if
  94. +x  has been given, ONLY the files having one of the quoted extensions
  95. will  be  listed.   -x  and  +x  are  in  conflict, and cannot be used
  96. together;  if both file name patterns and extensions have been used to
  97. select  files,  the  pattern  matching  is  done  first  and  then the
  98. extension is checked.
  99.  
  100.      The format field has been changed this way: in the format string,
  101.   -  %p will be changed to the file path, e.g. RAM: or WORK:TEX/PK/ ;
  102.   -  %s will be changed to the file name, e.g. TREE.C or MAKEFILE ;
  103.   -  %b will be changed to the file size, in bytes;
  104.   -  %d will be changed to the file date, e.g. 08-May-1986;
  105.   -  %t will be changed to the file time, e.g. 09:10:11;
  106.   -  %% is the character "%" itself;
  107.   -  %q is the double quote character ("), so that files having in the
  108.         name a blank can be surrounded with quotes: e.g. "tree >T:temp
  109.         -f "delete %q%p%s%q" ... "  will generate a  command file that
  110.         will delete EVERY file in the directory tree.
  111.   -  every other character  in the format string  is simply copied  to
  112.      stdout.
  113.  
  114.  
  115.      Apart   from   "diff"   (described  in  DIFF_README)  and  "tree"
  116. (described  in  detail  just now), here are the specific calls for the
  117. other programs:
  118.  
  119.  
  120. HEAD      Usage:   head [-N] [file [file [ ... ]]]
  121.           Purpose: prints on stdout the first N (default: 10) lines
  122.                    read from the given file(s), or from stdin.
  123.  
  124.  
  125. TAIL      Usage:   tail [-N | +N] [file [file [ ... ]]]
  126.           Purpose: prints on stdout the last N (default: 10)  lines
  127.                    read from the given file(s), or from stdin. With
  128.                    +N, skips the first N input lines and prints the
  129.                    remainder.
  130.  
  131.  
  132. SORT      Usage:   sort [-r][-f|-n][+N|-N][-tx] [file [file [ ... ]]]
  133.           Purpose: sorts  the records  read from the  input  file(s),
  134.                    or from stdin, to stdout.
  135.               -r : reverse order sorting
  136.               -n : numeric sorting              \ Default: alphabetic
  137.               -f : folds uppercase to lowercase /          sorting
  138.               -N : sorts starting at column N   \ Default: start
  139.               +N : sorts respect to field N     /         at column 1
  140.            -t... : separator  character(s)  between fields  (default:
  141.                    space)
  142.  
  143.  
  144. STRINGS   Usage:   strings [-N] [-A] [-L] [file [file [ ... ]]]
  145.           Purpose: prints on stdout the "strings" found in the given
  146.                    file(s), or in stdin.  A "string" is defined as a
  147.                    sequence of  at least N  (default:  4)  printable
  148.                    characters ended from newline or a NULL;  or as a
  149.                    sequence of N printable characters, if the switch
  150.                    -A (for ALL) has been given. The switch -L limits
  151.                    printable characters to the range 0x0-0x7F,  NULL
  152.                    to DEL, and then do not consider printables 8 bit
  153.                    characters.
  154. -----
  155.  
  156.      All  the  program  I  have  written are public domain, and can be
  157. freely  used  and  distributed;  they can be also freely modified, but
  158. please  leave  my  name in the header comments - and send me a copy of
  159. your  changes  at one of the addresses quoted at the end of this file.
  160. The source code is in the directory "Source". "diff" is subject to the
  161. GNU  license,  and  the  original  "tree"  has been released as public
  162. domain software by Tom.
  163.  
  164. -----
  165.  
  166. Special thanks to: Angela Schmidt (pattern.library);
  167.                    Tomas Rokicki  (tree);
  168.                    Stefan Boberg  (LhA);
  169.                    The GNU group  (diff).
  170.  
  171. -----
  172.  
  173.           Have fun!
  174.                                                 MLO
  175. -----
  176.  
  177. Author:  Maurizio Loreti, aka MLO or I3NOO.            
  178. Address: University of Padova - Department of Physics   
  179.          Via F. Marzolo, 8 - 35131 PADOVA - Italy      
  180. Phone:   (39)(49) 844-313         FAX: (39)(49) 844-245
  181. E-Mail:  LORETI at IPDINFN (BITNET),  or VAXFPD::LORETI
  182.          (DECnet). VAXFPD is DECnet node 38.257 or 39169;
  183.          INTERNET: LORETI@PADOVA.INFN.IT . All these
  184.          addresses refer to the same computer, a VAX
  185.          8600 owned from the Italian Agency for Research
  186.          in High Energy Physics (I.N.F.N.).
  187. Home: Via G. Donizetti 6 - 35010 CADONEGHE (PD) - Italy
  188.  
  189.  
  190. Home setup: Amiga 500, A501, A590 20MB Hard Disk, 3 MB total memory;
  191.             an Hewlett-Packard Deskjet 500.
  192. Work setup: Amiga 3000 16 MHz, 50 MB Hard Disk, 6 MB total memory;
  193.             and another Hewlett-Packard Deskjet 500.
  194. Software: CygnusEd Professional, SAS-C 5.10, FlexeLint for the Amiga.
  195.